import React from 'react';
import * as PropTypes from 'prop-types';
import styles from './style/index.less';

class Title extends React.Component {
  static defaultProps = {
    title: ''
  }

  render() {
    const { title, style, children } = this.props;

    return (
      <div className={`${styles.Title}`}>
        <div className={styles.header}><h2 className={styles.h2}>{title}</h2></div>
        <div className={styles.inner} style={style}>{children}</div>
      </div>
    );
  }
}

Title.propTypes = {
  title: PropTypes.string
}

export default Title;